{include file='comdir/head.html'}
<body>
<div class="content">
	<div class="animated fadeInDown">
		<div class="btn-box">
			<button class="btn btn-sm btn-success adminuserAdd">添加</button>
		</div>
		<div class="searchBox">
            <form class="form-inline" action="{$_URL}Special/addArticles" method="get">
                <span>
                 登陆名称：<input type="text" class="form-control name " name="name" value="">
                </span>
                <span>
                 手机号码：<input type="text" class="form-control mobile " name="mobile" value="">
                </span>
                <span><input type="button" class="form-control btn-blue userinfo_searh" value="搜索"></span>
            </form>
        </div>
		<div class="table_list_wrap">
			<div class="table-responsive">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>ID</th>
							<th>头像</th>
							<th>登录名</th>
							<th>显示名称</th>
							<th>手机号码</th>	
							<th>微信OPENID</th>	
							<th>QQ</th>		
							<th>在线</th>
							<th>创建时间</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody class="listtbody">
					{foreach from=$list item=vo}
					<tr>
						<td>{$vo.id}</td>
						<td><img style="max-widht:40px;max-height:30px;" src="{$getConfig.upload_http}{$vo.userface}"></td>
						<td>{$vo.name}</td>
						<td>{$vo.showname}</td>
						<td>{$vo.mobile}</td>
						<td>{$vo.openid}</td>
						<td>{$vo.qq}</td>
						<td>{if $vo.online==1}在线{else}离线{/if}</td>
						
						<td>{if $vo.addtime}{$vo.addtime|date_format:'%Y-%m-%d %H:%M:%S'}{/if}</td>
						<td>{if $vo.status==1}正常{else}禁用{/if}</td>
						<td>
							
							<input type="button" onclick="edit({$vo.id})" class="btn btn-xs btn-warning" value="编辑">
						</td>
					</tr>
					{/foreach}
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<div class="page-box">
			<div class="page">
				{if $list}
					{$pageshow}
				{/if}
			</div>
		</div>
</div>
 
<script type="text/javascript">
var _URL='{$_URL}';
{literal}
$(function(){
	$('.adminuserAdd').click(function(){
		window.location.href=_URL+"Userinfo/add";
	})
	//用户搜索
	$('.userinfo_searh').click(function(){
		ajaxpage(false);
	})
})
//编辑管理员
function edit(id){
	window.location.href=_URL+"Userinfo/edit?id="+id;
}
//权限设置
function role(id){
	window.location.href=_URL+'Userinfo/role?id='+id;
}
function ajaxpage(page){
	url='';
	url+=_sousuo.value('.name','name');
	url+=_sousuo.value('.mobile','mobile');
	if(page){
		url+="page="+page;
	}else{
		if(url!=''){
			url=url.substring(0,url.length-1);
		}
	}
	_ajaxs.post(_URL+"Userinfo/lists",url,function _return(data){
		$('.listtbody').html('');
		$('.listtbody').html(data.data.list);
		if(data.data.pageshow){
			$('.page').html(data.data.pageshow);
		}else{
			$('.page').html('');
		}
	},'json')
}
{/literal}
</script>
</body>
</html>